package com.knxhd.pojo;

import java.util.List;

import com.knxhd.enums.Role;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Author: tianluhua
 * Date: 2025-07-12 15:14:00
 * Description: 大模型响应结果
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class LlmResponse {

    private List<Choice> choices;

    private Usage usage;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static class Choice {

        private String text;

        private int index;

        private MessageDetail message;

        private String finishReason;

        public Choice(MessageDetail message) {
            this.message = message;
        }

    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class MessageDetail {

        private Role role;

        private String content;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static class Usage {

        private int completionTokens;

        private int promptTokens;

        private int totalTokens;
    }

}
